<?php
html::printPath(array(
    'exerciseGroup.form-title' => '/admin/exerciseGroup/all',
    $exerciseGroup['name'] => '/admin/exerciseGroup/display?code=' . $exerciseGroup['code'],
    sql::isPersistent($exerciseGroupL10n) ? 'exerciseGroup.editThisL10n' : 'exerciseGroup.createNewL10n' => ''
));
$msg->printMessages();

if (sql::isPersistent($exerciseGroupL10n)) {
    echo '<ul class="commandList">';
    echo '<li class="deleteLi">' . html::anchor('admin/exerciseGroup/deleteLocalizedValues?exercise_group_code=' . $exerciseGroup['code'] . '&language_code=' . $exerciseGroupL10n['language_code'], text::get('application.deleteThisL10n'), array('onclick'=>'return confirmDeletion()')) . '</li>';
    echo '</ul>';
}

$fb = new FormBuilder('exerciseGroup', $exerciseGroupL10n);
$fb->setAction('/admin/exerciseGroup/saveLocalizedValues');
$fb->text('exercise_group_code')->readOnly();
$fb->comboBox('language_code', $languageOptions)->required()->readOnly(sql::isPersistent($exerciseGroupL10n));
$fb->text('name')->required();
$fb->textarea('description')->required();
$fb->submitButton();
$fb->write();
